package org.example;

public class Manager extends FixedSalaryEmployee {
    private static final double EARNED_MIN = 115000;
    private static final double EARNED_MAX = 140000;

    private double earned = Math.round(Math.random() * (EARNED_MAX - EARNED_MIN) + EARNED_MIN);

    private double bonus = 5;   // % of earned

    public Manager(Company company, double fixedSalary) {
        super(company, fixedSalary);
    }

    @Override
    public double getMonthSalary() {
        return super.getMonthSalary() + earned * bonus / 100;
    }
}
